<template>
  <el-image
    class="user-message-avatar"
    fit="fill"
    :src="avatar"
  />
</template>

<script>
import { getOssUrl } from '@src/util/assets'
const head_left = getOssUrl('/avatar.png')
const head_right = getOssUrl('/avatar.png')

export default {
  name: 'avatar',
  props:{
    msgInfo:{
      type:Object,
      default:()=>({})
    }
  },
  computed:{
    avatar(){
      if(this.msgInfo.sendUserHead){
        return this.msgInfo.sendUserHead
      }
      return this.msgInfo.rightDisplay ? head_right : head_left
      
    }
  },
  data() {
    return {};
  },
  methods: {},
};
</script>

<style scoped lang='scss'>
.user-message-avatar {
  cursor: pointer;
}
</style>
